package com.gzy.cs5.exception;

public enum ErrorCode {
    INSUFFICIENT_STOCK("INSUFFICIENT_STOCK", "库存不足"), // 添加参数
    ORDER_ITEM_INVALID("ORDER_ITEM_INVALID", "订单项无效"),
    ORDER_ITEM_LIMIT_EXCEEDED("ORDER_ITEM_LIMIT_EXCEEDED", "订单项数量超出限制"),
    ORDER_NO_MAIN_ITEM("ORDER_NO_MAIN_ITEM", "订单中没有主食"),
    ORDER_DESSERT_WITHOUT_MAIN("ORDER_DESSERT_WITHOUT_MAIN", "订单中有甜品但没有主食"),
    ORDER_ICE_COFFEE_AFTER_3PM("ORDER_ICE_COFFEE_AFTER_3PM", "15:00之后不能下单冰咖啡"),
    ORDER_CANCEL_TIMEOUT("ORDER_CANCEL_TIMEOUT", "订单取消超时"),
    ORDER_NOT_FOUND("ORDER_NOT_FOUND", "订单未找到"),
    ORDER_STATUS_INVALID("ORDER_STATUS_INVALID", "订单状态无效"),
    ORDER_STATUS_INVALID_TRANSITION("ORDER_STATUS_INVALID_TRANSITION", "订单状态转换无效"),
    ORDER_EMPTY("ORDER_EMPTY", "订单不能为空"),
    ITEM_OUT_OF_STOCK("ITEM_OUT_OF_STOCK", "商品库存不足"),
    MODIFY_FORBIDDEN("MODIFY_FORBIDDEN", "修改被禁止"),
    ITEM_INVALID("ITEM_INVALID", "商品无效"),
    CONFLICT_PROMOTION("CONFLICT_PROMOTION", "存在冲突的促销活动"),
    MODIFICATION_REJECTED("MODIFICATION_REJECTED", "修改被拒绝"),
    MOB("MOB","订单id不能为空"),
    INVALID_MODIFICATION_TYPE("INVALID_MODIFICATION_TYPE", "修改类型无效"),
    ITEM_NOT_FOUND("ITEM_NOT_FOUND", "商品未找到"); // 添加 ITEM_NOT_FOUND 错误代码


    private final String code;
    private final String message;

    ErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}